import scrapy

class WwwXrsoComSpider(scrapy.Spider):
    name = 'starSpider'
    root_domain = 'http://www.xrso.com'
    allowed_domains = ['www.xrso.com']
    start_urls = ['http://www.xrso.com/mingxing/']

    def parse(self, response):
        print("1111")
        for item in response.xpath('//div[@class="item"]'):
            yield  {
                'img': item.xpath('//img').attrib["src"],
                'name': item.css('.title::text'),
                'info_link': item.css('.title::attr(href)').get(),
            }
        next_page = response.xpath("//li[@class='active']/following-sibling::li/a").attrib["href"]
        if next_page is not None:
            next_page = response.urljoin(next_page)
            print(next_page)
            yield scrapy.Request(next_page, callback=self.parse)